package com.wiz.netty.service;

import java.util.concurrent.RejectedExecutionHandler;
import java.util.concurrent.ThreadPoolExecutor;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 队列为满/异常处理的策略，需重新制定线程池参数
 * @author Hakeny
 */
public class PoolExceptionHandler implements RejectedExecutionHandler{
	private transient final Logger log = LoggerFactory.getLogger(PoolExceptionHandler.class);

	@Override
	public void rejectedExecution(Runnable arg0, ThreadPoolExecutor arg1) {
		log.warn("BussinessThreadPool warn threadpool too many task to be start----"+arg0.toString());
		new Thread(arg0,"pool error").start();
	}
}
